<script lang="ts" setup>
import { computed } from "vue";

interface TextPriceProps {
  color?: string;
}

const props = withDefaults(defineProps<TextPriceProps>(), {});

function getColor(value: any) {
  if (value === undefined) return null;
  const map: { [index: string]: string } = {
    gray: "var(--text-gray)",
  };
  return value?.indexOf("#") !== -1 ? value : map[value];
}

const styles = computed(() => {
  return {
    color: getColor(props.color),
  };
});
</script>

<template>
  <umi-space align="end">
    <umi-text :style="styles">￥</umi-text>
    <umi-text :style="styles">
      <slot></slot>
    </umi-text>
  </umi-space>
</template>
